package com.gongj.main;

import com.gongj.config.MyConfig;
import com.gongj.entity.User;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AnnotateTest {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
		BeanDefinition myConfig = context.getBeanFactory().getBeanDefinition("myConfig");
		BeanDefinition mz = context.getBeanFactory().getBeanDefinition("mz");
		User myUserBean = (User)context.getBean("mz");
		System.out.println("mz =" + mz);
		System.out.println("myUserBean = " + myUserBean);
	}


	public static void main1(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
		BeanDefinition helloController = context.getBeanFactory().getBeanDefinition("helloController");

	}
}
